package ljl.codetop300;

public class _125_palin {

  public boolean isPalindrome(String s) {
    s = s.toLowerCase().replaceAll("\\W", "");
    int l = 0, r = s.length() - 1;
    while (l < r) {
      if (s.charAt(l) != s.charAt(r)) return false;
      l++; r--;
    }
    return true;
  }
}
